home *** CD-ROM | disk | FTP | other *** search
- #define MacroPreProcess movem.l a0/a4/d0-d1, -( sp );\
- movem.l a0, -( sp );\
- jsr SetCurrentA4;\
- movem.l ( sp )+, a0;\
- fralloc;
-
- #define MacroSaveValues move.l a0, d0;\
- move.l d0, -( sp );\
- jsr CopyHParamBlockValues;\
- frfree;
-
- #define MacroCallOriginalTrap movem.l ( sp )+, a0/a4/d0-d1;\
- jsr ( a1 );\
- tst.w d0;\
- bne getOut;\
- movem.l a0-a7/d0-d7, -( sp );\
- movem.l a0/d0, -( sp );\
- jsr SetCurrentA4;\
- movem.l ( sp )+, a0/d0;\
- jsr SetArrayElement;\
- movem.l ( sp )+, a0-a7/d0-d7;\
- getOut:\
- rts;
-
- // Global variables.
- long gNextFreeElement = 0L;
- long gLastRetrievedElement = 0L;
- Boolean gReentrant = false;
- ProcPtr gFSPatchProcPtr;
- StringPtr gTempStringPtr;
- UniversalProcPtr gCallbackProcPtr = 0L;
-
- // Hold all file info until success of File Mgr operation is determined.
- HParmBlkPtr gParamBlockCopy = nil;
-
- // The parameters for _HCreate.
- typedef struct FSPatchGlobals
- {
- short theTrapId;
- short theVRefNum;
- long theParID;
- Str32 theString;
- OSType theFileType;
- } FSPatchGlobals, *FSPatchGlobalsPtr;
-
- enum {
- kCreateFlag,
- kDeleteFlag,
- kCopyFlag,
- kRenameFlag
- };
-
- typedef struct FWData
- {
- short theTrapId;
- short theVRefNum;
- long theParID;
- Str63 theString;
- OSType theFileType;
- } FWData, *FWDataPtr;
-
- typedef struct FWSubscribe
- {
- short theAction;
- long theCallbackAddr;
- } FWSubscribe, *FWSubscribePtr;
-
- // Define the callback conventions.
- ProcInfoType uppCreateFileProcInfo = kPascalStackBased
- | RESULT_SIZE( kNoByteCode )
- | STACK_ROUTINE_PARAMETER( 1, SIZE_CODE( sizeof( FWData ) ) )
- ;
-
- // Use an array of structs to track the calls to _Create.
- // Better performance than dynamic memory allocation,
- // especially for a patch.
- FSPatchGlobals gFSPatchGlobals[ MAX_NUM_FILES ];
- #endif
-
-